Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Categorical dashboard filters #1677

Merged
merged 22 commits into from
Aug 13, 2024
Merged

Conversation

bprusinowski
Copy link
Collaborator

@bprusinowski bprusinowski commented Jul 25, 2024

Closes #1669

This PR introduces categorical dashboard filters.

  • Each categorical filter displays all available dimension values; there's no cascading filters behavior, as every chart can have a different combination of other filters, which makes it impossible to have a "global cascading filter logic"
  • Global categorical filters take precedence over local, chart-defined interactive filters, whose UI is disabled when global filters are active
  • Cascading interactive filters behavior for chart is disabled when global categorical filters are enabled – in this mode we want to see no data, when a given combination actually yields no data, instead of reloading the chart filters and being out-of-sync with global filters.

How to test

  1. Go to this link.
  2. Add two more charts, so that there are three in total.
  3. Modify the filters of every chart in a way that there's a different set of filters for every chart.
  4. Proceed to layout options.
  5. Switch to dashboard / free canvas layout.
  6. See that there are four shared filters to be selected.
  7. Toggle the filters and see that the select elements appeared on top of the canvas.
  8. Use the filters to see that every chart adheres to global filters.
  9. Toggle the filters off to see that the chart reverts back to its original filters.
  10. You can also experiment with adding interactive filters to charts and seeing that they would be overwritten by global filters and that the state is reverted back to individual interactive filter after disabling global filter.

To do in the future

  • Refactor interactive filters so that they are scoped per cube. Currently if there are dimensions with the same iris across different cubes, we'd combine them and filter as one.

@bprusinowski bprusinowski requested a review from ptbrowne as a code owner July 25, 2024 09:26
Copy link

vercel bot commented Jul 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
visualization-tool ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 13, 2024 0:51am

app/charts/shared/chart-data-filters.tsx Show resolved Hide resolved
chartConfig.interactiveFiltersConfig.dataFilters.componentIris.some(
(componentIri) =>
!dashboardFilters?.dataFilters.componentIris.includes(componentIri)
);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Could this be part of the chartFiltersState that is computed just below ?

app/components/dashboard-interactive-filters.tsx Outdated Show resolved Hide resolved
@ptbrowne ptbrowne self-requested a review July 31, 2024 12:18
Copy link
Collaborator

@ptbrowne ptbrowne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

app/charts/shared/chart-data-filters.tsx Outdated Show resolved Hide resolved
@ptbrowne ptbrowne merged commit a0130d7 into main Aug 13, 2024
5 of 7 checks passed
@ptbrowne ptbrowne deleted the feat/categorical-dashboard-filters branch August 13, 2024 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

✅ Categorical Shared Filters
2 participants